import time

from selenium.webdriver.common.by import By

from base.page_base import PageBase


class PageAddSarch(PageBase):
    search_01 = (By.XPATH, '//android.widget.TextSwitcher[@resource-id="com.netease.yanxuan:id/tv_home_search"]')
    input_mess_02 = (By.XPATH, '//android.widget.EditText[@resource-id="com.netease.yanxuan:id/search_input"]')
    click_search_03 = (By.XPATH, '//android.widget.TextView[@resource-id="com.netease.yanxuan:id/tv_search_button"]')

    click_get_text_05=(By.XPATH,'//android.widget.TextView[@resource-id="com.netease.yanxuan:id/tv_goods_name"]')
    click_back_01=(By.ID,'com.netease.yanxuan:id/nav_left_text')
    click_back_02=(By.ID,'com.netease.yanxuan:id/search_bar_return')
    def click_search(self,text):
        self.base_click(self.search_01)
        self.base_click(self.input_mess_02)
        self.base_input_text(self.input_mess_02, text)
        self.base_click(self.click_search_03)


    def get_text(self):
        self.base_get_text(self.click_get_text_05)


